// 路由配置文件
import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/car-list',
    name: 'CarList',
    component: () => import('../views/car/CarList.vue')
  },
  {
    path: '/car-detail/:id',
    name: 'CarDetail',
    component: () => import('../views/car/CarDetail.vue')
  },
  {
    path: '/pet-list',
    name: 'PetList',
    component: () => import('../views/pet/PetList.vue')
  },
  {
    path: '/pet-detail/:id',
    name: 'PetDetail',
    component: () => import('../views/pet/PetDetail.vue')
  },
  {
    path: '/compare',
    name: 'Compare',
    component: () => import('../views/Compare.vue')
  },
  {
    path: '/user-profile',
    name: 'UserProfile',
    component: () => import('../views/user/UserProfile.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/user/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/user/Register.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 